package com.sxt.springcloud.sys;


import com.sxt.springcloud.sys.fallback.CacheClientfFallbackService;
import com.sxt.sys.common.DataGridView;
import com.sxt.sys.common.ResultObj;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-BUS",fallbackFactory = CacheClientfFallbackService.class)
@RequestMapping("/p/cache")
public interface CacheClientService {

    /**
     * 查询所有缓存
     */
    @RequestMapping("loadAllCache")
    DataGridView loadAllCache();

    /**
     * 删除缓存
     */
    @RequestMapping("deleteCache")
    ResultObj deleteCache(@RequestParam("key") String key);

    /**
     * 清空缓存
     */
    @RequestMapping("removeAllCache")
    ResultObj removeAllCache();

    /**
     * 同步缓存
     */
    @RequestMapping("syncCache")
    ResultObj syncCache();
}
